from utils import post_to_twitter

def update_twitter(sender, **kwargs):
    tweet = kwargs['instance']
    
    if not tweet.twitter_id:
        response = post_to_twitter(tweet.content)
        tweet.twitter_id = response['id']
        tweet.source = response['source']
        tweet.truncated = response['truncated']